home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
60750
/
60750.xpi
/
chrome
/
chromeFiles
/
content
/
bindings
/
btboombutton.xml
< prev
next >
Wrap
Extensible Markup Language
|
2010-01-20
|
3KB
|
85 lines
<?xml version="1.0"?>
<bindings id="btbuttonBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="btboombutton" extends="xul:box">
<content>
<xul:hbox>
<xul:button anonid="btboombutton-button"/>
</xul:hbox>
</content>
<handlers>
<handler event="command">
<![CDATA[
var subject = {};
subject.wrappedJSObject = this.brandObject;
this.observerService.notifyObservers(subject, "brandthunder", event.target.id);
if (this.url) {
this.brandObject.utilities.openLink(this.brandObject, event, this.url);
}
]]>
</handler>
</handlers>
<implementation>
<constructor>
<![CDATA[
this.observerService = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
if (this.hasAttribute('btBoomBundle')) {
this.btBoomBundle = document.getElementById(this.getAttribute('btBoomBundle'));
}
if (this.hasAttribute('brand')) {
this.brandObject = BrandThunder.clients[this.getAttribute('brand')];
}
if (this.brandObject) {
this.btPrefBranch = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService)
.getBranch("extensions.brandthunder.");
}
if (this.btBoomBundle) {
var url = this.getString(this.id + ".url");
if (url) {
this.url = url;
}
}
if (this.btPrefBranch && this.hasAttribute("image")) {
var currentBoom = this.btPrefBranch.getCharPref("currentBoom");
document.getAnonymousElementByAttribute(this, 'anonid', 'btboombutton-button')
.setAttribute("image", "chrome://" + this.brandObject.packageName + "/skin/" +
currentBoom + "/" + this.getAttribute("image"));
}
]]>
</constructor>
<destructor>
</destructor>
<field name="btPrefBranch"/>
<field name="brandObject"/>
<field name="btBoomBundle"/>
<field name="url"/>
<field name="sidebar"/>
<field name="observerService"/>
<method name="getString">
<parameter name="id"/>
<body>
<![CDATA[
var string;
if (this.btBoomBundle) {
try {
string = this.btBoomBundle.getString(id);
} catch(ex) {
}
}
return string;
]]>
</body>
</method>
</implementation>
</binding>
</bindings>